/**
 *
 */
package org.suren.littlebird.views.filter;

import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.viewers.ViewerFilter;
import org.suren.littlebird.po.SuRenBundle;

/**
 * @author suren
 *
 */
public class SuRenBundleViewerFilter extends ViewerFilter
{
	private String name = "";

	@Override
	public boolean select(Viewer viewer, Object parentEle, Object ele)
	{
		SuRenBundle bundle = (SuRenBundle) ele;

		if(bundle.getName() == null)
		{
			return true;
		}

		return (bundle.getName().indexOf(name) != -1);
	}

	/**
	 * @return the name
	 */
	public String getName()
	{
		return name;
	}

	/**
	 * @param name the name to set
	 */
	public void setName(String name)
	{
		this.name = name;
	}

}
